It is often required to add functionality to existing applications—for example security. in many cases it is required to add functionality at a certain point in the subject application, it is impossible to run a separate application before or after the subject application, and this is possible today only by rewriting the code, as explained here. CPUs and other processing code engines operate by executing machine code. This machine code, which is generally referred to as binary code, or by the shorthand binary, is usually the result of a compilation of higher-level languages.
In addition, most platforms come with an operating system which requires that machine code which is to be executed on the platform must come packed in some sort of container which dictates the layout of the binary. It is one of the tasks of the compiler to package the resulting machine code into the container. The container is sometimes referred to as an object file.
It is often desired to modify or enhance the function of an existing object file by splicing or appending new machine code to the object file. Changing code is relatively simple but adding a new functionality is a problem.
This proves impossible due to two factors:
1. Modifications applied to source code are not applicable in the output of a compiler.
2. The structure of object files does not allow room for adding new code.
Specifically adding a code will not allow a position dependent code (SP, PC) to continue operating properly